package vn.com.bookstore.database.sobject;

import vn.com.bookstore.database.SDatabaseObject;
import vn.com.bookstore.database.adbException;

@SuppressWarnings("serial")
public class BookMark extends SDatabaseObject {
	public static final String CLASS_UNIQUE = "Bookmark";
	public static final int NUM_FIELDS = 4;

	public String bookId = "";
	public String pageId = "";
	public String position = "";
	public String time = "";

	public BookMark(int index, String... values) {
		super(index, values);
		try {
			if (values.length != NUM_FIELDS)
				throw new adbException(CLASS_UNIQUE + " length values invalid!");
		} catch (adbException e) {
			e.printStackTrace();
		}
		bookId = values[0];
		pageId = values[1];
		position = values[2];
		time = values[3];
	}

	@Override
	public String[] getValues() {
		values[0] = bookId;
		values[1] = pageId;
		values[2] = position;
		values[3] = time;
		return values;
	}
}
